package site.isscloud.project.domain;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.fasterxml.jackson.annotation.JsonFormat;
import site.isscloud.common.annotation.Excel;
import site.isscloud.common.core.domain.BaseEntity;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 告警事件对象 pj_alarm_event
 */
public class PjAlarmEvent extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 事件ID */
    @Excel(name = "事件ID")
    private Long id;

    /** 事件编号，唯一标识 */
    @Excel(name = "事件编号")
    private String eventNo;

    /** 设备号 */
    @Excel(name = "设备号")
    private String deviceNo;

    /** 通道，0=通道1, 98=激光器故障 */
    @Excel(name = "通道")
    private Integer chanel;

    /** 报警类型：1=断纤告警, 2=激光器故障, 3=温度 */
    @Excel(name = "报警类型", dictType = "alarm_type")
    private Integer alarmType;

    /** 报警米标（温度报警专用） */
    @Excel(name = "报警米标")
    private Integer meterMark;

    /** 告警开始时间（第一个告警的时间） */
    @Excel(name = "告警开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date alarmStartTime;

    /** 告警关闭时间（最后一个告警记录时间+3分钟） */
    @Excel(name = "告警关闭时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date alarmCloseTime;

    /** 事件状态：0=活跃中, 1=关闭, 2=已处理 */
    @Excel(name = "事件状态", dictType = "alarm_state")
    private Integer eventStatus;

    /** 归集的告警记录总数 */
    @Excel(name = "归集的告警记录总数")
    private Integer alarmCount;

    /** 第一个告警记录ID */
    @Excel(name = "第一个告警记录ID")
    private Long firstAlarmId;

    /** 最后一个告警记录ID */
    @Excel(name = "最后一个告警记录ID")
    private Long lastAlarmId;

    /** 所有告警记录ID数组 */
    @Excel(name = "所有告警记录ID数组")
    private String alarmIds;

    /** 最大温度值 */
    @Excel(name = "最大温度值")
    private BigDecimal maxTemperature;

    /** 最小温度值 */
    @Excel(name = "最小温度值")
    private BigDecimal minTemperature;

    /** 平均温度值 */
    @Excel(name = "平均温度值")
    private BigDecimal avgTemperature;

    /** 断纤位置 */
    @Excel(name = "断纤位置")
    private Integer fiberBreakPosition;

    /** 激光器温度 */
    @Excel(name = "激光器温度")
    private Integer laserTemperature;

    /** 事件处理结果 */
    @Excel(name = "事件处理结果")
    private String eventHandledResult;

    /** 事件处理人 */
    @Excel(name = "事件处理人")
    private String eventHandledBy;

    /** 事件处理完毕时间 */
    @Excel(name = "事件处理完毕时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date eventHandledTime;

    // ============ 新增位置相关字段 ============
    /** 位置编码 */
    @Excel(name = "位置编码")
    private String lcCode;

    /** 位置名称 */
    @Excel(name = "位置名称")
    private String lcName;

    /** 楼栋名称 */
    @Excel(name = "楼栋名称")
    private String buildingName;

    /** 单元名称 */
    @Excel(name = "单元名称")
    private String unitName;

    /** 电梯名称 */
    @Excel(name = "电梯名称")
    private String elevatorName;

    /** 楼层名称 */
    @Excel(name = "楼层名称")
    private String floorName;

    // Getters and Setters
    public Long getId() { return id; }
    public void setId(Long id) { this.id = id; }
    public String getEventNo() { return eventNo; }
    public void setEventNo(String eventNo) { this.eventNo = eventNo; }
    public String getDeviceNo() { return deviceNo; }
    public void setDeviceNo(String deviceNo) { this.deviceNo = deviceNo; }
    public Integer getChanel() { return chanel; }
    public void setChanel(Integer chanel) { this.chanel = chanel; }
    public Integer getAlarmType() { return alarmType; }
    public void setAlarmType(Integer alarmType) { this.alarmType = alarmType; }
    public Integer getMeterMark() { return meterMark; }
    public void setMeterMark(Integer meterMark) { this.meterMark = meterMark; }
    public Date getAlarmStartTime() { return alarmStartTime; }
    public void setAlarmStartTime(Date alarmStartTime) { this.alarmStartTime = alarmStartTime; }
    public Date getAlarmCloseTime() { return alarmCloseTime; }
    public void setAlarmCloseTime(Date alarmCloseTime) { this.alarmCloseTime = alarmCloseTime; }
    public Integer getEventStatus() { return eventStatus; }
    public void setEventStatus(Integer eventStatus) { this.eventStatus = eventStatus; }
    public Integer getAlarmCount() { return alarmCount; }
    public void setAlarmCount(Integer alarmCount) { this.alarmCount = alarmCount; }
    public Long getFirstAlarmId() { return firstAlarmId; }
    public void setFirstAlarmId(Long firstAlarmId) { this.firstAlarmId = firstAlarmId; }
    public Long getLastAlarmId() { return lastAlarmId; }
    public void setLastAlarmId(Long lastAlarmId) { this.lastAlarmId = lastAlarmId; }
    public String getAlarmIds() { return alarmIds; }
    public void setAlarmIds(String alarmIds) { this.alarmIds = alarmIds; }
    public BigDecimal getMaxTemperature() { return maxTemperature; }
    public void setMaxTemperature(BigDecimal maxTemperature) { this.maxTemperature = maxTemperature; }
    public BigDecimal getMinTemperature() { return minTemperature; }
    public void setMinTemperature(BigDecimal minTemperature) { this.minTemperature = minTemperature; }
    public BigDecimal getAvgTemperature() { return avgTemperature; }
    public void setAvgTemperature(BigDecimal avgTemperature) { this.avgTemperature = avgTemperature; }
    public Integer getFiberBreakPosition() { return fiberBreakPosition; }
    public void setFiberBreakPosition(Integer fiberBreakPosition) { this.fiberBreakPosition = fiberBreakPosition; }
    public Integer getLaserTemperature() { return laserTemperature; }
    public void setLaserTemperature(Integer laserTemperature) { this.laserTemperature = laserTemperature; }
    public String getEventHandledResult() { return eventHandledResult; }
    public void setEventHandledResult(String eventHandledResult) { this.eventHandledResult = eventHandledResult; }
    public String getEventHandledBy() { return eventHandledBy; }
    public void setEventHandledBy(String eventHandledBy) { this.eventHandledBy = eventHandledBy; }
    public Date getEventHandledTime() { return eventHandledTime; }
    public void setEventHandledTime(Date eventHandledTime) { this.eventHandledTime = eventHandledTime; }

    // 新增字段的getter和setter
    public String getLcCode() { return lcCode; }
    public void setLcCode(String lcCode) { this.lcCode = lcCode; }
    public String getLcName() { return lcName; }
    public void setLcName(String lcName) { this.lcName = lcName; }
    public String getBuildingName() { return buildingName; }
    public void setBuildingName(String buildingName) { this.buildingName = buildingName; }
    public String getUnitName() { return unitName; }
    public void setUnitName(String unitName) { this.unitName = unitName; }
    public String getElevatorName() { return elevatorName; }
    public void setElevatorName(String elevatorName) { this.elevatorName = elevatorName; }
    public String getFloorName() { return floorName; }
    public void setFloorName(String floorName) { this.floorName = floorName; }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("eventNo", getEventNo())
                .append("deviceNo", getDeviceNo())
                .append("chanel", getChanel())
                .append("alarmType", getAlarmType())
                .append("meterMark", getMeterMark())
                .append("alarmStartTime", getAlarmStartTime())
                .append("alarmCloseTime", getAlarmCloseTime())
                .append("eventStatus", getEventStatus())
                .append("alarmCount", getAlarmCount())
                .append("firstAlarmId", getFirstAlarmId())
                .append("lastAlarmId", getLastAlarmId())
                .append("alarmIds", getAlarmIds())
                .append("maxTemperature", getMaxTemperature())
                .append("minTemperature", getMinTemperature())
                .append("avgTemperature", getAvgTemperature())
                .append("fiberBreakPosition", getFiberBreakPosition())
                .append("laserTemperature", getLaserTemperature())
                .append("eventHandledResult", getEventHandledResult())
                .append("eventHandledBy", getEventHandledBy())
                .append("eventHandledTime", getEventHandledTime())
                .append("lcCode", getLcCode())
                .append("lcName", getLcName())
                .append("buildingName", getBuildingName())
                .append("unitName", getUnitName())
                .append("elevatorName", getElevatorName())
                .append("floorName", getFloorName())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }
}